home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / Game-Installer / WHD_Installers / Games_C-D / Install Captive < prev    next >
Text File  |  1977-12-31  |  4KB  |  178 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")   ;name of readme file
  4. (set #cleanup "")    ;files to delete after install
  5. (set #last-file "RaTtDOS")  ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if 
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "RawDIC")
  37. (P_chkrun)
  38.  
  39. (if
  40.   (= @user-level 2)
  41.   (
  42.     (set #CI_drive
  43.       (askchoice
  44.    (prompt "Select source drive for diskimages")
  45.    (default 0)
  46.    (choices "DF0:" "DF1:" "DF2:" "DF3:")
  47.    (help @askchoice-help)
  48.       )
  49.     )
  50.     (select #CI_drive
  51.       (set #CI_drive "DF0:")
  52.       (set #CI_drive "DF1:")
  53.       (set #CI_drive "DF2:")
  54.       (set #CI_drive "DF3:")
  55.     )
  56.   )
  57.   (set #CI_drive "DF0:")
  58. )
  59.  
  60. (set @default-dest
  61.   (askdir
  62.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  63.     (help @askdir-help)
  64.     (default @default-dest)
  65.     (disk)
  66.   )
  67. )
  68. (set #dest (tackon @default-dest @app-name))
  69. (if
  70.   (exists #dest)
  71.   (
  72.     (set #choice
  73.       (askbool
  74.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  75.         (default 1)
  76.         (choices "Delete" "Skip")
  77.         (help @askbool-help)
  78.       )
  79.     )
  80.     (if
  81.       (= #choice 1)
  82.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  83.     )
  84.   )
  85. )
  86. (makedir #dest
  87.   (help @makedir-help)
  88.   (infos)
  89. )
  90.  
  91. (set #capfiles ("%s/Fed1" #dest))
  92. (makedir #capfiles)
  93.  
  94. ;----------------------------
  95.  
  96. (if
  97.   (exists ("%s.newicon" @app-name))
  98.   (set #icon
  99.     (askchoice
  100.       (prompt "\nWhich icon do you like to install ?\n")
  101.       (default 0)
  102.       (choices "Normal" "NewIcon")
  103.       (help @askchoice-help)
  104.     )
  105.   )
  106.   (set #icon 0)
  107. )
  108. (select #icon
  109.   (set #icon ("%s.inf" @app-name))
  110.   (set #icon ("%s.newicon" @app-name))
  111. )
  112. (copyfiles
  113.   (help @copyfiles-help)
  114.   (source #icon)
  115.   (newname ("%s.info" @app-name))
  116.   (dest #dest)
  117. )
  118. (copyfiles
  119.   (help @copyfiles-help)
  120.   (source ("%s.slave" @app-name ))
  121.   (dest #dest)
  122. )
  123. (if
  124.   (exists #readme-file)
  125.   (copyfiles
  126.     (help @copyfiles-help)
  127.     (source #readme-file)
  128.     (dest #dest)
  129.   )
  130. )
  131. (if
  132.   (exists ("%s.info" #readme-file))
  133.   (copyfiles
  134.     (help @copyfiles-help)
  135.     (source ("%s.info" #readme-file))
  136.     (dest #dest)
  137.   )
  138. )
  139.  
  140. (copyfiles
  141.   (help @copyfiles-help)
  142.   (source ("%s.islave" @app-name))
  143.   (dest #capfiles)
  144. )
  145.  
  146. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s\nDelete %s.islave" #capfiles @app-name #CI_drive @app-name))
  147.  
  148. (if
  149.   (exists (tackon #capfiles #last-file))
  150.   ("")
  151.   (abort "Diskimaging not successful !\nRawDIC was unable to create all needed files !")
  152. )
  153.  
  154. (set #capsave
  155.   (askbool
  156.     (prompt ("\nInstall Captive Save disk ?"))
  157.       (default 1)
  158.       (choices "Install" "Skip")
  159.       (help @askbool-help)
  160.   )
  161. )
  162. (if
  163.   (= #capsave 1)
  164.   ((copyfiles
  165.     (help @copyfiles-help)
  166.     (source ("%sSave.islave" @app-name))
  167.     (dest #capfiles)
  168.   )
  169.   (run ("CD \"%s\"\nRawDIC SLAVE=%sSave.islave SOURCE=%s\nDelete %sSave.islave" #capfiles @app-name #CI_drive @app-name))
  170.   )
  171. )
  172.  
  173. ;----------------------------
  174.  
  175. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  176.  
  177. (exit)
  178.